package com.demo.component.srv;

import org.springframework.stereotype.Component;

/**
 * Author:  Hardy
 * Date:    2018/7/18 20:05
 * Description: RabbitMQ 接收组件 提供2种接收处理方式
 *
 * 1.
 * @since RabbitConfig
 *      接收队列指定:
 *         SimpleMessageListenerContainer container = new SimpleMessageListenerContainer();
 *         ...
 *         container.setQueues(queue); / container.setQueueNames(queueName);
 *
 * @Component
 * public class Receiver {
 *     private static final Logger log = LoggerFactory.getLogger(Receiver.class);
 *
 *     public void message(User user) {
 *         log.info(JsonTool.toJson(user));
 *     }
 * }
 *
 *
 * 2.
 * @since RabbitConfig
 * 接收队列不指定 在注解中指定
 *
 * @Component
 * public class Receiver {
 *     private static final Logger log = LoggerFactory.getLogger(Receiver.class);
 *
 *     @RabbitListener(queues = "test")
 *     public void message(User user) {
 *         log.info(JsonTool.toJson(user));
 *     }
 * }
 * @RabbitListener(queues = "test")
 * public class Receiver {
 *     private static final Logger log = LoggerFactory.getLogger(Receiver.class);
 *
 *    @RabbitHandler
 *    public void message(User user) {
 *         log.info(JsonTool.toJson(user));
 *    }
 * }
 */

@Component
public class Receiver {
}
